<?php
getAllFixPercentResult($a, array(1=>20, 2=>30, 3=>70), 100);

function getAllFixPercentResult(&$results, $limit, $gross) {
	$limitKey = array_keys($limit);
	$limitValue = array_values($limit);
	$limitValueSum = array_sum($limitValue);
	//生成各部分区间
	$startNow = 0;
	foreach ($limit as $k => $v) {
		$section[$k] = array($startNow, $startNow+=round($gross*$v/$limitValueSum));
	}
	print_r($section);
}